package helper;

import org.achartengine.renderer.XYSeriesRenderer;

import android.graphics.Color;

public class RendererFactory {
	public static final int ORANGE_GRADIENT = 0;
	public static final int GREEN = 1;
	public static final int PURPLE = 2;
	public static final int YELLOW = 3;
	public static final int WHITE = 4;

	public XYSeriesRenderer createRendererFactory(int i) {
		switch (i) {
		case ORANGE_GRADIENT:
			return new Orange_GradientRenderer();
		case WHITE:
			return new WhiteRenderer();
		case PURPLE:
			return new PurpleRenderer();
		case GREEN:
			return new GreenRenderer();
		case YELLOW:
			return new YellowRenderer();
		default:
			return new Orange_GradientRenderer();
		}
	}

	private class BaseRenderer extends XYSeriesRenderer {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public BaseRenderer() {
			this.setDisplayChartValues(true);
		}
	}

	public class YellowRenderer extends BaseRenderer {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public YellowRenderer() {
			super();
			this.setColor(Color.rgb(255, 215, 0));

		}
	}

	private class Orange_GradientRenderer extends BaseRenderer {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public Orange_GradientRenderer() {
			super();
			this.setColor(Color.rgb(255, 99, 71));
			this.setGradientStart(-50, Color.BLACK);
			this.setGradientStop(50, Color.rgb(255, 99, 71));

		}
	}

	private class GreenRenderer extends BaseRenderer {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public GreenRenderer() {
			super();
			this.setColor(Color.rgb(50, 205, 50));
			this.setGradientStart(-30, Color.BLACK);
			this.setGradientStop(30, Color.rgb(50, 205, 50));
			this.setGradientEnabled(true);
		}
	}

	private class WhiteRenderer extends BaseRenderer {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public WhiteRenderer() {
			super();
			this.setColor(Color.rgb(255, 245, 239));
		}
	}

	private class PurpleRenderer extends BaseRenderer {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public PurpleRenderer() {
			super();

			this.setColor(Color.rgb(218, 112, 214));

		}
	}
}